home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Contrib / STk-wtour / lessons / canvas6.stk < prev    next >
Encoding:
Text File  |  1995-12-13  |  648 b   |  20 lines

  1. ;; Canvases with scrollbars
  2.  
  3. (canvas '.c4 :scrollregion '(-10c -10c 50c 20c)
  4.          :xscrollcommand (lambda l (apply .s2 'set l))
  5.          :yscrollcommand (lambda l (apply .s1 'set l)))
  6.  
  7. (.c4 'create 'rectangle 100 100 400 400 :fill "red")
  8. (.c4 'create 'rectangle 300 300 600 600 :fill "green")
  9. (.c4 'create 'rectangle 200 200 500 500 :fill "blue")
  10.  
  11. (scrollbar '.s1 :orient "vert" :relief "sunken"
  12.            :command (lambda l (apply .c4 'yview l)))
  13. (scrollbar '.s2 :orient "hor" :relief "sunken"
  14.            :command (lambda l (apply .c4 'xview l)))
  15.  
  16. (pack .s2 :side "bottom" :fill "x")
  17. (pack .s1 :side "right"  :fill "y")
  18. (pack .c4 :expand "yes"  :fill "both")
  19.  
  20.